<?
echo "hello";
echo '<pre>';
print_r($_SESSION);
echo '</pre>';
/**
 * Created by PhpStorm.
 * User: WangXiaoHong
 * Date: 15-9-29
 * Time: 下午2:28
 */
exit;
$ac1="124612";
$pw1="d11c3ad8d15920a649185feb09bf87ab"; //票付通账号跟密码
$s1 = new SoapClient(null,array(
    "location" =>"http://112.124.14.164/open/openService/pft_insideMX.php",
    "uri" =>"www.16u.com?ac_16u=16ucom|pw_16u=c33367701511b4f6020ec61ded352059|auth_16u=true"));
//查询景区列表
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("Get_ScenicSpot_List",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>1,"in2"=>''))));
//echo '</pre>';
//查询景区详细信息
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("Get_ScenicSpot_Info",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>10633))));
//echo '</pre>';
//门票列表
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("Get_Ticket_List",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>10633,"in2"=>''))));
//echo '</pre>';
////动态价格、库存上限获取
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("Dynamic_Price_And_Storage",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>19220,"in2"=>"2015-11-12","in3"=>2,"in4"=>1,"in5"=>0))));
//echo '</pre>';


//订单查询
echo '<pre>';
print_r(simplexml_load_string($s1->__soapCall("Order_Globle_Search",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>864590,"in2"=>516293,
    "in3"=>124612,"in4"=>22132,"in5"=>"","in6"=>"","in7"=>"2015-10-12 00:00:12","in8"=>"2015-12-12 00:00:12","in9"=>"",
    "in10"=>"","in11"=>"","in12"=>"","in13"=>"","in14"=>"","in15"=>"","in16"=>"13848831931","in17"=>"","in18"=>"","in19"=>"",
    "in20"=>"","in21"=>"","in22"=>10,"in23"=>0,"in24"=>"13848831931","in25"=>"","in26"=>"","in27"=>""))));
echo '</pre>';


//提交订单
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("PFT_Order_Submit",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>10633,"in2"=>22132,"in3"=>"","in4"=>1,"in5"=>2,"in6"=>"2015-10-29","in7"=>"王","in8"=>"13675094589",
//    "in9"=>"13675094589","in10"=>1,"in11"=>2,"in12"=>0,"in13"=>"","in14"=>"","in15"=>0,
//"in16"=>0,"in17"=>46888))));
//echo '</pre>';

//订单短信发送、重发接口
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("reSend_SMS_Global_PL",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>2380997))));
//echo '</pre>';

//修改、取消订单
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("Order_Change_Pro",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>2674177,"in2"=>1,"in3"=>"18094156978"))));
//echo '</pre>';

//自定义短信发送
//echo "自定义短信发送有错";
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("Send_SMS_System_Fee",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>"13675094589",
//    "in2"=>"您已成功预订黄山翡翠谷：成人票:1张,凭证号418276，游玩时间：2014-05-19起，三十天内有效，（请至景区售票处报皖南风情加电子凭证号取票，客服电话：0559-2530211）"))));
//echo '</pre>';

//凭证码查看
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("Terminal_Code_Verify",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>"2380997"))));
//echo '</pre>';

//资金余额查看
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("PFT_Member_Fund",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>0))));
//echo '</pre>';

//会员关系查看
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("PFT_Member_Relationship",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>1))));
//echo '</pre>';

//产品抓取通知接口
//echo "产品抓取通知接口有错";
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("Product_Catch_Inform",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>3))));
//echo '</pre>';

//集时通自助短信接口
//echo '<pre>';
//print_r(simplexml_load_string($s1->__soapCall("SMS_User_Defined",array("ac"=>$ac1,"pw"=>$pw1,"in1"=>"fzpft","in2"=>"ab8888","in3"=>"13675094589","in4"=>"山东蓝翔一日游:成人票:1张，凭证号，310180，游玩时间:2015-01-06，取票信息:无需取票，此为入园凭证，请妥善保管。详情及二维码:http://12301.cc/3y2lsy"))));
//echo '</pre>';






exit;


//
//exit;
//if(!$_GET['csjhs'])exit("这里什么都没有~");
?>


<head>
    <meta charset="UTF-8" />
    <title>Kana 找不到WinMail</title>
</head>
<p>limit : 查询条数 </p>
<div>status%5B%5D 订单状态 0-4分别是 未使用 已使用 已过期 已取消</div>
<div>pmode%5B%5D 支付方式 </div>
<div>pays%5B%5D 支付方式 </div>
<p>btime2:有效期<p>
<form action="" method="get">
    order_id:<input name='order_id' value='<?=$_GET['order_id']?>'>
    mid:<input name='mid' value='<?=$_GET['mid']?>'>
    aid:<input name='aid' value='<?=$_GET['aid']?>'>
    lid:<input name='lid' value='<?=$_GET['lid']?>'>
    ctl:<input name='contacttel' value='<?=$_GET['contacttel']?>'>
    area:<input name='area' value='<?=$_GET['area']?>'>
    <br/>
    查询条数:<input name='limit' value='<?=$_GET['limit']?>'>
    tid:<input name='tid' value='<?=$_GET['tid']?>'>
    <br/>
    时间类型:
    <select name='timetype'>
        <option value='1' <?if($_GET['timetype']=='1') echo '  selected="selected"';?>>下单时间</option>
        <option value='2' <?if($_GET['timetype']=='2') echo '  selected="selected"';?>>预计游玩</option>
        <option value='3' <?if($_GET['timetype']=='3') echo '  selected="selected"';?>>完成时间</option>
    </select>
    开始时间:<input type='date' name='begintime' value='<?=$_GET['begintime']?>'>
    结束时间:<input type='date' name='endtime' value='<?=$_GET['endtime']?>'>
    ifpack:<input type='' name='ifpack' value='<?=$_GET['ifpack']?>'>
    concat:<input type='' name='concat' value='<?=$_GET['concat']?>'>
    <br/>
    <input type='hidden' name='csjhs' value='11'>
    查询类型:
    <select name='c'>
        <option value='0' <?if($_GET['c']=='0') echo '  selected="selected"';?>>订单详情</option>
        <option value='1' <?if($_GET['c']=='1') echo '  selected="selected"';?>>订单总数</option>
        <option value='2' <?if($_GET['c']=='2') echo '  selected="selected"';?>>订单,票,金额总数</option>
        <option value='9' <?if($_GET['c']=='9') echo '  selected="selected"';?>>订单,票,金额总数(不含转分销)</option>
    </select>
    sid:<input type='' name='sid' value='<?=$_GET['sid']?>'>
    remotenum:<input type='' name='remotenum' value='<?=$_GET['remotenum']?>'>
    <br/>
    <input type="submit" value="查询"/><br/>

    <form>
        <?
        $mid=$_GET['mid'];
        $aid = $_GET['aid'];
        $order_id = $_GET['order_id'];
        $lid = $_GET['lid'];
        $tid = $_GET['tid'];
        $time1=$_GET["begintime"]?$_GET["begintime"]:date("Y-m-d",strtotime('-1days'));
        $time1= $time1." 00:00:00";
        echo "<br/>";
        $time2=$_GET["endtime"]?$_GET["endtime"]:date("Y-m-d");
        $time2 = $time2." 23:59:59";
        switch ($_GET['timetype']) {
            case '1':
            default:
                $btime1 = $time1;
                $etime1 = $time2;
                break;
            case '2':
                $btime2 = $time1;
                $etime2 = $time2;
                break;
            case '3':
                $btime3 = $time1;
                $etime3 = $time2;
                break;

        }
        //$btime2 = $_GET['begintime2'] ? $_GET['begintime2'].' 00:00:00' : '';
        //$etime2 = $_GET['endtime2'] ? $_GET['endtime2'].' 23:59:59' :'';
        $status=$_GET['status'];
        $c=$_GET['c'] ? $_GET['c'] : '0';
        $contacttel = $_GET['contacttel'];
        $area = $_GET['area'];
        $remotenum = $_GET['remotenum']+0 == 0 ? '' : $_GET['remotenum'];
        $sta="";
        echo '<pre>';
        print_r($status);
        echo '</pre>';
        if(is_array($status)){
            foreach($status as $k => $v ){
                $sta .= $v.'|';
            }
            $sta = rtrim($sta,'|');
            echo $sta; echo "<br/>";
        }

        $pm = $_GET['pmode'];
        $pays = $_GET['pays'];
        echo '<pre>';
        print_r($pays);
        echo '</pre>';
        if(is_array($pays)){
            foreach($pays as $k => $v ){
                $pa .= $v.'|';
            }
            $pa = rtrim($pa,'|');
            echo $pa; echo "<br/>";
        }

        $limit =$_GET['limit']?$_GET['limit']:10000;

        $s = new SoapClient(null,array(
                "location" => "http://localhost/open/openService/pft_insideMX.php",
                "uri" => "www.16u.com?ac_16u=16ucom|pw_16u=c33367701511b4f6020ec61ded352059|auth_16u=true")
        );
        echo "<br/>";
        $atime = microtime(true);
        if($c=='0'){
            $x= simplexml_load_string(
                $s->Order_Globle_Search(
                    $_GET['sid'],$mid, "$lid", "$tid", "", "", "$btime1", "$etime1", "$btime2", "$etime2",
                    "$btime3", "$etime3", "$order_id", "", "$contacttel", "$sta", "$pa", "", "", "",
                    "0", $limit, "$c", "0", "$pm", "0", "$remotenum", "0", "", "",
                    $aid,$_GET['concat'],$_GET['ifpack'], "0","",'',$contacttel));
        }else{
            $x= $s->Order_Globle_Search(
                $_GET['sid'],$mid, "$lid", "$tid", "", "", "$btime1", "$etime1", "$btime2", "$etime2",
                "$btime3", "$etime3", "$order_id", "", "$contacttel", "$sta", "$pa", "", "", "",
                "0", $limit, "$c", "0", "$pm", "0", $remotenum, "0", "", "",
                $aid,$_GET['concat'],$_GET['ifpack'], "0",$area,$contacttel);
            var_dump($x);
        }
        echo '(
"'.$_GET['sid'].'","'.$mid.'", "'.$lid.'", "'.$tid.'", "", "", "'.$btime1.'", "'.$etime1.'", "'.$btime2.'", "'.$etime2.'",
        "'.$btime3.'", "'.$etime3.'", "'.$order_id.'", "", "'.$contacttel.'", "'.$sta.'", "'.$pa.'", "", "", "",
        "0", "'.$limit.'", "'.$c.'", "0","'.$pm.'","0","'.$remotenum.'","0","","",
        "'.$aid.'","'.$_GET['concat'].'","'.$_GET['ifpack'].'","0","'.$area.'","'.$contacttel.'")';

        echo '<pre>';
        print_r($x->xpath('/Data/Rec/UUordernum'));
        echo '</pre>';
        foreach($x as $key =>$val)
        {
            $ret["status"]=$val->UUordernum;
            $ret["ordernum"]=$val->UUstatus;
            $ret["tnum"]=$val->UUtnum;
            $return[]=$ret;
        }
        echo '<pre>';
        print_r($return);
        echo '</pre>';
        echo  microtime(true) - $atime ;

        exit;
        ?>
 
